let util = require('../../utils/util.js')
let that = null

function initMessageContentView(source, notice, activateKlass = false) {
  that = source
  if (notice.createdAt) {
    notice.uiCreatedAt = util.formatDateTime(notice.createdAt);
  }

  if (notice.images) {
    notice.imagesArray = notice.images;
  }

  that.setData({
    notice: notice,
    activateKlass: activateKlass
  })
}

function previewImage(current,urls) {
  wx.previewImage({
    current: current,
    urls: urls
  })
}

module.exports = {
  initMessageContentView: initMessageContentView,
  previewImage: previewImage
}